-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix nat_gateway_enabled=false InvalidNatGatewayId.Malformed error #45
Conversation
…private subnets aws_route resource * Error is 'InvalidNatGatewayId.Malformed: Invalid id: "0" (expecting "nat-...")' * Make nat_gateway_enabled variable type explicit boolean * Remove dummy_az_ngw_ids and return empty map when disabled, which means private.tf nat_gateways_route_count is not dependent on the results of the apply * Tried using a local list with conditional comparison to the "0" constant but then dependent on the results of the apply * Added new fixture in eu-west-1 region and new test * terraform get -update fails when running tests in parallel hence disabled * Tested route tables with nat_gateway_enabled flag disabled and enabled (tests would need an extra output to test in code)
/test all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paulrob-100 this looks good to me and you obviously put a good bit of work into it so thank you. I'm going to call in a 2nd reviewer here since this isn't a trivial change. @Nuru you mind taking a look at this when you get the chance?
Thanks @Gowiem. I'm looking at the failing test to see if I can reproduce.
|
I'm not able to reproduce the failing test locally @Gowiem. |
Design note:- I think I prefer #47 implementation which means this local disappears in the merge. |
My attempt at fixingIt looks like the example that it's trying to apply depends on terraform-aws-multi-az-subnets/examples/complete/main.tf Lines 32 to 41 in 5e04ef2
Perhaps a depends_on = [module.public_subnets] That should hopefully allow Edit: I tried it and it didn't work. Interesting issue. |
Thanks for your investigation @nitrocode. However in this case I am using variables or derived local values which are known at plan time, as recommended. |
Also found this other one hashicorp/terraform#26207 The module design seems very similar here with the root module passing the output of one module to another. This one also fixed by the same merge hashicorp/terraform#27849 |
@paulrob-100 Thank you for your submission, we really appreciate it. However (@Gowiem please note) we have another submission, #47, which is a more complete solution, so we are going to focus on that. I greatly appreciate that you added tests. For future reference (and although you would not know it from just looking at this module), we only run tests in |
what
why
references